|
|
|
|
|
|
|
Figure 14.14
Refer to the summary page for
tips on finishing your control. |
|
|
|
|
|
|
|
|
Take a look at some of the pieces of the code that is generated. First, in the General Declarations section, you will find that the wizard has created constants for the default values of any unmapped properties. The CharAccept property has been given a default value of 0. In addition, the wizard has automatically created the private property variable mCharAccept. It is followed by the declaration of any events that you requested be included in the control. A sample of this code is shown here. If you mapped any events, you will notice that the wizard places comments in the code to indicate how events are mapped to constituent control events: |
|
|
|
|
|
|
|
|
Option Explicit
'Default Property Values:
Const m_def_BackColor = 0
Const m_def_ForeColor = 0
Const m_def_CharAccept = 0
'Property Variables:
Dim m_BackColor As Long
Dim m_ForeColor As Long
Dim m_CharAccept As Integer
'Event Declarations:
Event Click() 'MappingInfo=txtCharset,txtCharset,-1,Click
Event DblClick()
Event UserError()
Event KeyPress(KeyAscii As Integer) |
|
|
|
|
|
|
|
|
The declarations of variables and events are followed by the property procedures. These procedures are created for properties that are mapped to a component property and those that are custom properties. As you can see in the following code segment, the code for the Text property is complete, whereas the CharAccept property has a skeleton function ready to be finished: |
|
|
|
|
|
|
|
|
'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=txtCharset,txtCharset,-1,Text
Public Property Get Text() As String
Text = txtCharset.Text
End Property
Public Property Let Text(ByVal New_Text As String)
txtCharset.Text() = New_Text
PropertyChanged "Text"
End Property |
|
|
|
|
|